<?php

function Qiniu_Encode($str) // URLSafeBase64Encode
{
    $find = array('+', '/');
    $replace = array('-', '_');

    return str_replace($find, $replace, base64_encode($str));
}
